package collection.homework;

import java.util.Set;
import java.util.TreeSet;

public class Demo04Compare {
    public static void main(String[] args) {
        Student[] studnets = new Student[]{
                new Student("liusan", 20, 90.0f),
                new Student("liusi", 22, 90.0f),
                new Student("wangwu", 20, 99.0f),
                new Student("sunliu", 22, 100.0f),
        };

        Set<Student> set = new TreeSet<>();
        for (Student studnet : studnets) {
            set.add(studnet);
        }

        System.out.println(set);
    }
}
